package quickcheck;

import java.util.Date;

import net.java.quickcheck.generator.iterable.Iterables;
import tester.Tester;
import tester.UDTGenerator;



/**
 * 
 * @author Sachin Venugopalan
 * 
 * AuthorTest Using QuickCheck Integrated Tester
 */
public class QCITTest {

	/**
	 * 
	 * @param t
	 */
	public void testCompany(Tester t) {
		int i = 0;
		for(Company cpy : Iterables.toIterable(new UDTGenerator<Company>(Company.class))) {
			
			System.out.println(String.format("%4d: %-40s%-40s%-40s", i, cpy.name, cpy.founded, cpy.revenueLastYear));
			//System.out.println(i + ":\t" + cpy.name + "; " + cpy.founded + "; " + cpy.revenueLastYear);
			//t.checkExpect(new Author(author.getName(), author.getAge()), author, "Success");
			i++;
		}
	}

	/**
	 * 
	 * @param argv
	 */
	public static void main(String[] argv) {
		QCITTest at = new QCITTest();

//		System.out.println("Show all data defined in the QCITTest class:");
		System.out.println("\n\n---------------------------------------------------");
		System.out.println("Invoke tester.runReport(this, true, true):");
		System.out.println("Print all data, all test results");

		Tester.runReport(at, true, true);

		System.out.println("\n---------------------------------------------------");
		System.out.println("\n---------------------------------------------------");
		System.out.println("\n---------------------------------------------------");
		System.out.println("Invoke tester.runReport(this, false, false, true):");
		System.out.println("Print no data, all test results, no warnings");

		Tester.runReport(at, false, false);
	}
}
